<?php
/**
 * 
 * 지하철 model
 * @author gudals
 *
 */

class modelContSubwayInfo extends modelContBase
{
    /**
     * 
     * 도시 정보
     * @return Ambigous <NULL, multitype:void , void, unknown>
     */
    public function getCityList()
    {
        $sQuery = "
            select
                city_no,
                city
            from
                subway_info
            group by
                city_no
        ";
        
        return $this->executeQuery($sQuery, 'rows');
    }
    
    /**
     * 
     * 호선 정보
     * @param int $iCityNo 도시코드
     */
    public function getLineList($iCityNo)
    {
        if (empty($iCityNo)) return false;
        
        $sQuery = "
            select
                line_no,
                line
            from
                subway_info
            where
                city_no = '".$iCityNo."'
            group by
                line_no
        ";
        
        return $this->executeQuery($sQuery, 'rows');
    }
    
    /**
     * 
     * 역 정보
     * @param int $iCityNo 도시코드
     * @param int $iLineNo 호선코드
     * @return boolean|Ambigous <NULL, multitype:void , void, unknown>
     */
    public function getStationList($iCityNo, $iLineNo)
    {
        if (empty($iCityNo) || empty($iLineNo)) return false;
        
        $sQuery = "
            select
                *
            from
                subway_info
            where
                city_no = '".$iCityNo."'
            and
                line_no = '".$iLineNo."'
        ";
        
        return $this->executeQuery($sQuery, 'rows');
    }
}